import request from '@/utils/request'


export default{
    upload(file,homeworkId,token){
        return request({
            url: 'api/workfile/upload',
            method: 'post',
            headers: {
                'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq'
            },
            params:{
                "token":token,
                "homeworkId":homeworkId
            },
            data: file
        });
    },
    getfileList(token,homeworkId){
        return request({
            url: 'api/workfile/getList',
            method: 'get',
            params:{
                "token":token,
                "homeworkId":homeworkId
            }
        })
    },
    downloadAll(homeworkId,token){
        return request({
            url: 'api/workfile/downloadAll',
            method: 'get',
            params:{
                "token":token,
                "homeworkId":homeworkId
            }
        })
    },
    deleteOne(workfileId){
        return request({
            url: 'api/workfile/deleteOne',
            method: 'delete',
            params:{
                "id":workfileId
            }
        })
    },
    getZipList(homeworkId){
        return request({
            url: 'api/workfile/getZipFile',
            method: 'get',
            params:{
                "id":homeworkId
            }
        })
    }
}